import {PageContainer} from "@ant-design/pro-components";
import {useParams} from "@umijs/max";
import {useEffect} from "react";
import {Card, Form, Input, InputNumber} from "antd";
import {edit} from "../service";

export default ()=>{
  const [form] = Form.useForm();
  const params = useParams();

  useEffect(()=>{
    edit(params).then(result=>{
      form.setFieldsValue(result.data)
    })
  })

  return (
    <PageContainer title={false} breadcrumb={{}}>
      <Card>
        <Form form={form} labelCol={{ span: 4 }} wrapperCol={{ span: 20 }}>
          <Form.Item name='id' label='id' style={{display: 'none'}} >
            <Input />
          </Form.Item>
          <Form.Item name='code' label='code'>
            <Input disabled />
          </Form.Item>
          <Form.Item name='name' label='name'>
            <Input disabled />
          </Form.Item>
          <Form.Item name='baseBetMoney' label='baseBetMoney'>
            <InputNumber style={{width:'100%'}} precision={0} step={1} />
          </Form.Item>
          <Form.Item name='baseTimes' label='baseTimes'>
            <InputNumber style={{width:'100%'}} precision={0} step={1} />
          </Form.Item>
          <Form.Item name='continuousLostTimes' label='continuousLostTimes'>
            <InputNumber style={{width:'100%'}} precision={0} step={1} />
          </Form.Item>
          <Form.Item name='maxBetMoney' label='maxBetMoney'>
            <InputNumber style={{width:'100%'}} precision={0} step={1} />
          </Form.Item>
          <Form.Item name='odds' label='odds'>
            <InputNumber style={{width:'100%'}} precision={2} step='0.01' />
          </Form.Item>
          <Form.Item name='predictionCount' label='predictionCount'>
            <InputNumber style={{width:'100%'}} precision={0} step={1} />
          </Form.Item>
          <Form.Item name='walletIndex' label='walletIndex'>
            <InputNumber style={{width:'100%'}} precision={0} step={1} />
          </Form.Item>
        </Form>
      </Card>
    </PageContainer>
  )
}
